<!-- 栏目表表单弹窗 -->
<form id="cmscategory-form" lay-filter="cmscategory-form" class="layui-form model-form" style="overflow:auto; height:500px;width:90%;">
    <input name="id" type="hidden"/>
    				    <div class="layui-form-item">
        <label class="layui-form-label">父级编号</label>
        <div class="layui-input-block">
            <input name="parentId" placeholder="请输入父级编号" type="text" class="layui-input" maxlength="20"  id="parentId"
                   lay-verify="required" required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">所有父级编号</label>
        <div class="layui-input-block">
            <input name="parentIds" placeholder="请输入所有父级编号" type="text" class="layui-input" maxlength="20"  id="parentIds"
                   lay-verify="required" required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-block">
            <input name="businessId" placeholder="请输入" type="text" class="layui-input" maxlength="20"  id="businessId"
                   lay-verify="required" required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">栏目模块，保留</label>
        <div class="layui-input-block">
            <input name="module" placeholder="请输入栏目模块，保留" type="text" class="layui-input" maxlength="20"  id="module"
                   lay-verify="required" required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">栏目名称</label>
        <div class="layui-input-block">
            <input name="name" placeholder="请输入栏目名称" type="text" class="layui-input" maxlength="20"  id="name"
                   lay-verify="required" required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">栏目图片</label>
        <div class="layui-input-block">
            <input name="image" placeholder="请输入栏目图片" type="text" class="layui-input" maxlength="20"  id="image"
                   lay-verify="required" required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">栏目链接</label>
        <div class="layui-input-block">
            <input name="href" placeholder="请输入栏目链接" type="text" class="layui-input" maxlength="20"  id="href"
                   lay-verify="required" required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">描述</label>
        <div class="layui-input-block">
            <input name="description" placeholder="请输入描述" type="text" class="layui-input" maxlength="20"  id="description"
                   lay-verify="required" required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">关键字</label>
        <div class="layui-input-block">
            <input name="keywords" placeholder="请输入关键字" type="text" class="layui-input" maxlength="20"  id="keywords"
                   lay-verify="required" required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-block">
            <input name="sort" placeholder="请输入排序" type="text" class="layui-input" maxlength="20"  id="sort"
                   lay-verify="required" required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">显示位置（保留）：1--分类页；2--导航等</label>
        <div class="layui-input-block">
            <input name="inShowwhere" placeholder="请输入显示位置（保留）：1--分类页；2--导航等" type="text" class="layui-input" maxlength="20"  id="inShowwhere"
                   lay-verify="required" required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">展示方式</label>
        <div class="layui-input-block">
            <input name="showModes" placeholder="请输入展示方式" type="text" class="layui-input" maxlength="20"  id="showModes"
                   lay-verify="required" required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">是否允许评论：1--允许；0--不允许</label>
        <div class="layui-input-block">
            <input name="allowComment" placeholder="请输入是否允许评论：1--允许；0--不允许" type="text" class="layui-input" maxlength="20"  id="allowComment"
                   lay-verify="required" required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">是否需要审核，1--需要；0--不需要</label>
        <div class="layui-input-block">
            <input name="isAudit" placeholder="请输入是否需要审核，1--需要；0--不需要" type="text" class="layui-input" maxlength="20"  id="isAudit"
                   lay-verify="required" required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">创建者</label>
        <div class="layui-input-block">
            <input name="createBy" placeholder="请输入创建者" type="text" class="layui-input" maxlength="20"  id="createBy"
                   lay-verify="required" required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">创建时间</label>
        <div class="layui-input-block">
            <input name="createDate" placeholder="请输入创建时间" type="text" class="layui-input" maxlength="20"  id="createDate"
                   lay-verify="required" required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">更新时间</label>
        <div class="layui-input-block">
            <input name="updateBy" placeholder="请输入更新时间" type="text" class="layui-input" maxlength="20"  id="updateBy"
                   lay-verify="required" required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-block">
            <input name="updateDate" placeholder="请输入" type="text" class="layui-input" maxlength="20"  id="updateDate"
                   lay-verify="required" required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">备注信息</label>
        <div class="layui-input-block">
            <input name="remarks" placeholder="请输入备注信息" type="text" class="layui-input" maxlength="20"  id="remarks"
                   lay-verify="required" required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">删除标记，0--未删除，1--删除</label>
        <div class="layui-input-block">
            <input name="delFlag" placeholder="请输入删除标记，0--未删除，1--删除" type="text" class="layui-input" maxlength="20"  id="delFlag"
                   lay-verify="required" required/>
        </div>
    </div>
     <div class="layui-form-item model-form-footer">
        <button class="layui-btn layui-btn-primary" ew-event="closeDialog" type="button">取消</button>
        <button class="layui-btn" lay-filter="user-form-submit" lay-submit>保存</button>
    </div>
</form>

<script>
    layui.use(['layer', 'admin', 'form', 'formSelects'], function () {
        var layer = layui.layer;
        var admin = layui.admin;
        var form = layui.form;
        var formSelects = layui.formSelects;
 
        var cmscategory = admin.getTempData('t_cmscategory');
           if (cmscategory.method=="update"){
        	form.val('cmscategory-form', cmscategory);
            form.render();
        }
        // 表单提交事件
        form.on('submit(user-form-submit)', function (data) {
             layer.load(2);
            
            admin.req('cms/cmscategory/'+cmscategory.method, JSON.stringify(data.field), function (data) {
                layer.closeAll('loading');
                if (data.code == 0) {
                    layer.msg(data.msg, {icon: 1, time: 500});
                    admin.finishPopupCenter();
                } else {
                    layer.msg(data.msg, {icon: 2, time: 500});
                }
            }, "post");  
            return false;
        });
    });
</script>
